
<?php 

// import the extension
Yii::import('ext.jqPrettyPhoto');

$options = array(
    'slideshow'=>5000,
    'autoplay_slideshow'=>false,
    'show_title'=>false
);
// call addPretty static function
jqPrettyPhoto::addPretty('.gallery a',jqPrettyPhoto::PRETTY_SINGLE,jqPrettyPhoto::THEME_FACEBOOK, $options);

?>
<div class="form">

<?php echo CHtml::beginForm('','post',array('enctype'=>'multipart/form-data')); ?>
	<?php //echo CHtml::errorSummary(array($model)); ?>
        <?php if(!$model->isNewRecord) : ?>

        <div class="gallery">
            <?php // echo CHtml::link(CHtml::image($avatarThumbnail),$avatar); ?>
        </div>
        <?php endif; ?>
     <?php if((Yii::app()->getRequest()->getParam('type')==User::S_SUPPLIER)||Yii::app()->getModule('user')->isSupplier()||Yii::app()->getModule('user')->isAdmin()): ?>
        <div class="row">
        <label for="RegistrationForm_full_name" class="required"><?php echo 'Tên công ty'; ?><span class="required">*</span></label>
	
	<?php echo CHtml::activeTextArea($model,'full_name',array('class'=>'full-name')); ?>
	<?php echo CHtml::error($model,'full_name'); ?>
	</div>
        <div class="row">
		<?php echo CHtml::activeLabelEx($model,'business'); ?>
		<?php echo CHtml::activeDropDownList($model,'business',  Category::listCategoryProduct()); ?>
		<?php echo CHtml::error($model,'business'); ?>
	</div>
    <?php endif; ?>
    <?php if(Yii::app()->getRequest()->getParam('type')==User::S_TRANSPORTER): ?>
        <div class="row">
            <label for="RegistrationForm_full_name" class="required"><?php echo 'Tên công ty'; ?><span class="required">*</span></label>
            <?php echo CHtml::activeTextArea($model,'full_name',array('class'=>'full-name')); ?>
            <?php echo CHtml::error($model,'full_name'); ?>
	</div>
        
        <div class="row">
		<?php echo CHtml::activeLabelEx($model,'method_tran'); ?>
		<?php echo CHtml::activeDropDownList($model,'method_tran',array('0'=>'Chọn loại hình vận chuyển','1'=>'Xe tải','2'=>'Thuyền')); ?>
		<?php echo CHtml::error($model,'method_tran'); ?>
	</div>
    <?php endif; ?>
        <div class="row">
		<?php echo CHtml::activeLabelEx($model,'email'); ?>
		<?php echo CHtml::activeTextField($model,'email',array('size'=>60,'maxlength'=>128)); ?>
		<?php echo CHtml::error($model,'email'); ?>
	</div>

	<div class="row">
		<?php echo CHtml::activeLabelEx($model,'password'); ?>
		<?php echo CHtml::activePasswordField($model,'password',array('size'=>60,'maxlength'=>128)); ?>
		<?php echo CHtml::error($model,'password'); ?>
	</div>

	<div class="row">
		<?php echo CHtml::activeLabelEx($model,'username'); ?>
		<?php echo CHtml::activeTextField($model,'username',array('size'=>20,'maxlength'=>20)); ?>
		<?php echo CHtml::error($model,'username'); ?>
	</div>
        
	<div class="row">
		<?php echo CHtml::activeLabelEx($model,'avatar'); ?>
		<?php echo CHtml::activeFileField($model,'avatar'); ?>
		<?php echo CHtml::error($model,'avatar'); ?>
	</div>        
<!--	<div class="row">-->
		<?php // echo CHtml::activeLabelEx($model,'status'); ?>
		<?php // echo CHtml::activeDropDownList($model,'status',User::itemAlias('UserStatus')); ?>
		<?php // echo CHtml::error($model,'status'); ?>
<!--	</div>-->
	<div class="row">
		<?php echo CHtml::activeLabelEx($model,'phone'); ?>
		<?php echo CHtml::activeTextField($model,'phone',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo CHtml::error($model,'phone'); ?>
	</div>

	<div class="row">
		<?php echo CHtml::activeLabelEx($model,'mobile'); ?>
		<?php echo CHtml::activeTextField($model,'mobile',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo CHtml::error($model,'mobile'); ?>
	</div>
        <div class="row">
		<?php echo CHtml::activeLabelEx($model,'province'); ?>
		<?php echo CHtml::activeDropDownList($model,'province',Yii::app()->getModule('user')->provinceArr); ?>
		<?php echo CHtml::error($model,'province'); ?>
	</div>
	<div class="row">
		<?php echo CHtml::activeLabelEx($model,'address'); ?>
		<?php echo CHtml::activeTextField($model,'address'); ?>
		<?php echo CHtml::error($model,'address'); ?>
	</div>
        <div class="row">
		<?php echo CHtml::activeLabelEx($model,'web'); ?>
		<?php echo CHtml::activeTextField($model,'web'); ?>
		<?php echo CHtml::error($model,'web'); ?>
	</div>
        <?php if(Yii::app()->getRequest()->getParam('type')==User::S_DEFAULT_USER): ?>
        <div class="row">
		<?php echo CHtml::activeLabelEx($model,'birthday'); ?>
		<?php echo CHtml::activeTextField($model,'birthday'); ?>
		<?php echo CHtml::error($model,'birthday'); ?>
	</div>
        <div class="row">
		<?php echo CHtml::activeLabelEx($model,'gender'); ?>
		<?php echo CHtml::activeDropDownList($model,'gender',User::itemAlias('UserGender')); ?>
		<?php echo CHtml::error($model,'gender'); ?>
	</div>
        <?php endif; ?>
	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? UserModule::t('Create') : UserModule::t('Save')); ?>
	</div>

<?php echo CHtml::endForm(); ?>

</div><!-- form -->